import request from '@/utils/request'

// 查询小红花兑换记录列表
export function listFlower(params) {
  return request({
    url: '/admin/api/flower/list',
    method: 'get',
    params
  })
}

// 查询小红花记录详细
export function getFlower(id) {
  return request({
    url: '/admin/api/flower/' + id,
    method: 'get'
  })
}

// 新增小红花记录
export function addFlower(data) {
  return request({
    url: '/admin/api/flower/add',
    method: 'post',
    data
  })
}

// 修改小红花记录
export function updateFlower(data) {
  return request({
    url: '/admin/api/flower/update',
    method: 'put',
    data
  })
}
// 修改小红花记录
export function useFlower(data) {
  return request({
    url: '/admin/api/flower/use',
    method: 'put',
    data
  })
}

// 删除小红花记录
export function del(data) {
  return request({
    url: '/admin/api/flower/delete',
    method: 'delete',
    data
  })
}

// 导出小红花记录
export function exportRecord(query) {
  return request({
    url: '/admin/api/flower/export',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
